// Author: combacsa@kaist.ac.kr
// http://www.jungol.co.kr/prog/Hanal/hanalView.php?qs_code=1002

//#define COMPILE
#ifdef COMPILE

#include <fstream>
using namespace std;

int gcd = 1;
int lcm = 1;

int getgcd(int a, int b) {
	if (a % b == 0) 
		return b;
	else if ( b % a == 0)
		return a;
	else {
		if (a < b) {
			int c = a;
			a = b;
			b = c;
		}
		return getgcd(b, a % b);
	}
}

void input() {
	ifstream in("input.txt");
	int n;
	int a;
	int b;
	
	in >> n;
	in >> a;
	in >> b;

	gcd = getgcd(a, b);
	lcm = (a / getgcd(a, b)) * b;

	a = lcm;
	for (int i = 2; i < n; i++) {
		in >> b;
		gcd = getgcd(gcd, b);
		lcm = (lcm / getgcd(lcm, b)) * b;
	}

	in.close();
}

void output() {
	ofstream out("output.txt");
	out << gcd << " " << lcm << endl;
	out.close();
}

int main() {
	input();

	output();

	return 0;
}
#endif
